<%--
  Created by IntelliJ IDEA.
  User: edy
  Date: 2022/4/2
  Time: 10:26 下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script>
    $(function () {
        $("#btn1").click(function () {
            var name = $("#name").val();
            $.post("/web08/ajax1",{"name":name},function(data) {
               if (data == 'success') {
                   alert(data);
               } else {
                   alert("失败")
               }

            },"text")


        })

    });


</script>

<body>



<input type="text" id="name">
<input type="button" id="btn1" value="提交">
</body>
</html>
